﻿ using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            //一维数组
            int[] arr = new int[10];
            for(int i =0;i<arr.Length;i++)
            {
                Console.WriteLine(arr[i]);
            }
            int[] arr1 = new int[3] { 1,2,3 };
            for(int i = 0; i < arr1.Length; i++)
            {
                Console.WriteLine(arr1[i]);
            }
            string[] arr2 = { "w", "x" };
            for (int i = 0; i < arr2.Length; i++)
            {
                Console.WriteLine(arr2[i]);
            }
            //多维数组
            int[,] arr3 = { { 15,12,321}, {43,22,33}, {44,55,22} };
            for (int i = 0;i<arr3.GetLength(0);i++)
            {
                for(int j =0;j<arr3.GetLength(1);j++)
                {
                    Console.WriteLine(arr3[i,j]);
                }
            }
            //foreach用法
            Console.WriteLine("下面的是foreach用法");
            foreach (int i in arr3)
            {
                Console.WriteLine(i);
            }
            //split用法
            Console.WriteLine("split演示");
            string str = "花有重开日,人无再少年";
            var b = str.Split(',');
            for (int i =0;i<b.Length;i++)
            {
                Console.WriteLine(b[i]);
            }
        }
    }
}
